from django.db import models
from utils.BaseModel import BaseModel

# Create your models here.
class Category(BaseModel):
    cname = models.CharField(max_length=100,verbose_name='分类名称')
    parent = models.ForeignKey('self',null=True,blank=True,on_delete=models.CASCADE,verbose_name='上级分类',related_name='children')
    ishome = models.BooleanField(default=False,verbose_name='是否推荐在首页')
    isgood = models.BooleanField(default=False,verbose_name='是否为精品课分类')
    def __str__(self):
        return self.cname
    class Meta:
        db_table = 'category'
